

$(document).ready(function(){

   
  $(".sel-opt").click(function(){$(this).siblings().slideToggle(500);});
  $(".sel-list-con>li").click(function(){
     $(this).parent().siblings().text($(this).text());
	 $(this).parent().slideToggle(500);
	 notifyUpdate();
  });
  

});

function request(url, callback){
		
    $.ajax({
             type: "POST",
             url: url,
             dataType: "json",
             success: function(data){
			    callback(data);
			 },
			 error : function(data){
			 
			 }

	});
}
	
function getRange(s, e, splitnum){

     var units = [1,1.5,2,2.5,5,7.5,10];
     function log(a, b){
        var c = (Math.log(b)) / (Math.log(a));
        return Math.floor(c);
     }
     function getInterval(n){
        n = Math.abs(n);
        var o = log(10,n),v = Math.pow(10,o),t = n / v;
        var index = 0;
        for(var i = 0;i < units.length;i++){
            if(t <= units[i]){
              index = i;
              break;
            }
         }
         return v * units[index];
     };
              

     var interval = getInterval((e - s) / splitnum);
     e = s + splitnum * interval;
     return {low:s,high:e};
       
}
           

